import React, { useState } from 'react';

const Index = () => {
    const [count, setCount] = useState(0)
    const add = () => {
        setCount(count + 1)
    }
    return (
        // <div onClick={() => {
        //     console.log(1);
        //     //count++               会报错
        //     //setCount(count++)     会报错
        //     setCount(count+1)
        // }}>
        <div onClick={add}>
            movie
            {count}
            {/* <button onClick={this.handleClick}></button> */}
        </div>
    );
}

export default Index;
